package com.wc.alorithm_blue_bridge._思维.开赛主题曲;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/12/31 17:22
 * @description
 * https://www.lanqiao.cn/problems/20096/learning/?contest_id=231
 */
public class Main {
    /**
     * 思路：
     * 找到前面第一个不满足重复要求的位置
     * 求前缀和 A, 求灵感 B
     * score = A + B
     * 与最好的比较, 替换
     */
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 200010;
    static char[] s = new char[N], t = " lanqiobe ".toCharArray();
    // pre[letter] 代表letter重复之前的位置, sum[i] 前缀和
    static int[] pre = new int[128], sum = new int[N];
    static int n;

    public static void main(String[] args) {
        n = sc.nextInt();
        s = (" " + sc.next()).toCharArray();
        for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + s[i] - 'a' + 1;
        String ans = "";
        // res 代表当前最高分数, tail代表最后面重复的字母的位置
        int res = 0, tail = 0;
        for (int i = 1; i <= n; i++) {
            tail = Math.max(pre[s[i]], tail);
            // score 当前字母作为尾部的分数 A, maxv 为B
            int score = sum[i] - sum[tail], maxv = 0;

            // 求 B
            for (int j = tail + 1; j <= i; j++) {
                int a = j, b = 1;
                while (a <= i && b < t.length && s[a] == t[b]) {
                    a++;
                    b++;
                }
                maxv = Math.max(maxv, (b - 1) * 10);
            }
            score += maxv;

            // 比较替换
            if (score > res) {
                res = score;
                ans = new String(s, tail + 1, i - tail);
            } else if (score == res) {
                String tmp = new String(s, tail + 1, i - tail);
                if (tmp.compareTo(ans) < 0) ans = tmp;
            }
            pre[s[i]] = i;
        }
        out.println(ans);
        out.flush();
    }
}

class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}

